package com.example.electronicmall.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.electronicmall.entity.OrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 
 * 
 * @author mwh
 * @email 1062966353@qq.com
 * @date 2022-12-09 17:40:06
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {

    void save(@Param("order") OrderEntity order);

    OrderEntity checkNoPayOrder(@Param("userId") Integer userId, @Param("shopId") Integer shopId);

    List<OrderEntity> listOrdersByUserId(@Param("userId") Integer userId);

    List<OrderEntity> listOrdersByBusinessId(@Param("businessId") Integer businessId);

    OrderEntity queryOrderByOrderId(@Param("orderId") String orderId);

    void updateOrderByOrderId(@Param("order") OrderEntity order);

    void updateOrderPrice(@Param("order") OrderEntity preOrder);

    void deleteOrderByOrderId(@Param("order") OrderEntity preOrder);
}
